<?php


namespace app\admin\validate;


use think\Validate;

class AdminUser extends Validate
{
    protected $rule = [
        'username' => 'require',
        'password' => 'require',
        'captcha' => 'require|checkCaptcha:abc'
    ];
    protected $message = [
        'username' => '必须要用户名',
        'password' => '必须要密码',
        'captcha' => '必须要验证码'
    ];

    protected function checkCaptcha($value,$rule,$data=[]){
        if (!captcha_check($value)){
            return '您输入的验证码不正确';
        }
        return  true;
    }
}